package com.lecture.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lecture.entity.UnitLoadRate;
import com.lecture.entity.UnitLoadRateParam;
import com.lecture.mapper.UnitLoadRateMapper;
import com.lecture.service.IUnitLoadRateService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 机组负荷率 服务实现类
 * </p>
 *
 * @author luyn
 * @since 2025-03-14
 */
@Service
public class UnitLoadRateServiceImpl extends ServiceImpl<UnitLoadRateMapper, UnitLoadRate> implements IUnitLoadRateService {

    @Override
    public List<UnitLoadRate> getUnitLoadRateList(UnitLoadRateParam param) {
        QueryWrapper<UnitLoadRate> queryWrapper = new QueryWrapper<>();
        // 对于 unit1_avg_capacity
       /* if (Func.isNotEmpty(param.getUnit1AvgCapacityMin()) && Func.isEmpty(param.getUnit1AvgCapacityMax())) {
            queryWrapper.gt("unit1_avg_capacity", param.getUnit1AvgCapacityMin());
        } else if (Func.isEmpty(param.getUnit1AvgCapacityMin()) && Func.isNotEmpty(param.getUnit1AvgCapacityMax())) {
            queryWrapper.lt("unit1_avg_capacity", param.getUnit1AvgCapacityMax());
        } else if (Func.isNotEmpty(param.getUnit1AvgCapacityMin()) && Func.isNotEmpty(param.getUnit1AvgCapacityMax())) {
            queryWrapper.between("unit1_avg_capacity", param.getUnit1AvgCapacityMin(), param.getUnit1AvgCapacityMax());
        }

// 对于 unit1_run_capacity
        if (Func.isNotEmpty(param.getUnit1RunCapacityMin()) && Func.isEmpty(param.getUnit1RunCapacityMax())) {
            queryWrapper.gt("unit1_run_capacity", param.getUnit1RunCapacityMin());
        } else if (Func.isEmpty(param.getUnit1RunCapacityMin()) && Func.isNotEmpty(param.getUnit1RunCapacityMax())) {
            queryWrapper.lt("unit1_run_capacity", param.getUnit1RunCapacityMax());
        } else if (Func.isNotEmpty(param.getUnit1RunCapacityMin()) && Func.isNotEmpty(param.getUnit1RunCapacityMax())) {
            queryWrapper.between("unit1_run_capacity", param.getUnit1RunCapacityMin(), param.getUnit1RunCapacityMax());
        }

// 对于 unit1_standby_capacity
        if (Func.isNotEmpty(param.getUnit1StandbyCapacityMin()) && Func.isEmpty(param.getUnit1StandbyCapacityMax())) {
            queryWrapper.gt("unit1_standby_capacity", param.getUnit1StandbyCapacityMin());
        } else if (Func.isEmpty(param.getUnit1StandbyCapacityMin()) && Func.isNotEmpty(param.getUnit1StandbyCapacityMax())) {
            queryWrapper.lt("unit1_standby_capacity", param.getUnit1StandbyCapacityMax());
        } else if (Func.isNotEmpty(param.getUnit1StandbyCapacityMin()) && Func.isNotEmpty(param.getUnit1StandbyCapacityMax())) {
            queryWrapper.between("unit1_standby_capacity", param.getUnit1StandbyCapacityMin(), param.getUnit1StandbyCapacityMax());
        }

// 对于 unit1_maintenance_capacity
        if (Func.isNotEmpty(param.getUnit1MaintenanceCapacityMin()) && Func.isEmpty(param.getUnit1MaintenanceCapacityMax())) {
            queryWrapper.gt("unit1_maintenance_capacity", param.getUnit1MaintenanceCapacityMin());
        } else if (Func.isEmpty(param.getUnit1MaintenanceCapacityMin()) && Func.isNotEmpty(param.getUnit1MaintenanceCapacityMax())) {
            queryWrapper.lt("unit1_maintenance_capacity", param.getUnit1MaintenanceCapacityMax());
        } else if (Func.isNotEmpty(param.getUnit1MaintenanceCapacityMin()) && Func.isNotEmpty(param.getUnit1MaintenanceCapacityMax())) {
            queryWrapper.between("unit1_maintenance_capacity", param.getUnit1MaintenanceCapacityMin(), param.getUnit1MaintenanceCapacityMax());
        }

// 对于 unit1_generation
        if (Func.isNotEmpty(param.getUnit1GenerationMin()) && Func.isEmpty(param.getUnit1GenerationMax())) {
            queryWrapper.gt("unit1_generation", param.getUnit1GenerationMin());
        } else if (Func.isEmpty(param.getUnit1GenerationMin()) && Func.isNotEmpty(param.getUnit1GenerationMax())) {
            queryWrapper.lt("unit1_generation", param.getUnit1GenerationMax());
        } else if (Func.isNotEmpty(param.getUnit1GenerationMin()) && Func.isNotEmpty(param.getUnit1GenerationMax())) {
            queryWrapper.between("unit1_generation", param.getUnit1GenerationMin(), param.getUnit1GenerationMax());
        }

// 对于 unit1_util_hours
        if (Func.isNotEmpty(param.getUnit1UtilHoursMin()) && Func.isEmpty(param.getUnit1UtilHoursMax())) {
            queryWrapper.gt("unit1_util_hours", param.getUnit1UtilHoursMin());
        } else if (Func.isEmpty(param.getUnit1UtilHoursMin()) && Func.isNotEmpty(param.getUnit1UtilHoursMax())) {
            queryWrapper.lt("unit1_util_hours", param.getUnit1UtilHoursMax());
        } else if (Func.isNotEmpty(param.getUnit1UtilHoursMin()) && Func.isNotEmpty(param.getUnit1UtilHoursMax())) {
            queryWrapper.between("unit1_util_hours", param.getUnit1UtilHoursMin(), param.getUnit1UtilHoursMax());
        }

// 对于 unit1_load_rate
        if (Func.isNotEmpty(param.getUnit1LoadRateMin()) && Func.isEmpty(param.getUnit1LoadRateMax())) {
            queryWrapper.gt("unit1_load_rate", param.getUnit1LoadRateMin());
        } else if (Func.isEmpty(param.getUnit1LoadRateMin()) && Func.isNotEmpty(param.getUnit1LoadRateMax())) {
            queryWrapper.lt("unit1_load_rate", param.getUnit1LoadRateMax());
        } else if (Func.isNotEmpty(param.getUnit1LoadRateMin()) && Func.isNotEmpty(param.getUnit1LoadRateMax())) {
            queryWrapper.between("unit1_load_rate", param.getUnit1LoadRateMin(), param.getUnit1LoadRateMax());
        }

// 对于 unit2_avg_capacity
        if (Func.isNotEmpty(param.getUnit2AvgCapacityMin()) && Func.isEmpty(param.getUnit2AvgCapacityMax())) {
            queryWrapper.gt("unit2_avg_capacity", param.getUnit2AvgCapacityMin());
        } else if (Func.isEmpty(param.getUnit2AvgCapacityMin()) && Func.isNotEmpty(param.getUnit2AvgCapacityMax())) {
            queryWrapper.lt("unit2_avg_capacity", param.getUnit2AvgCapacityMax());
        } else if (Func.isNotEmpty(param.getUnit2AvgCapacityMin()) && Func.isNotEmpty(param.getUnit2AvgCapacityMax())) {
            queryWrapper.between("unit2_avg_capacity", param.getUnit2AvgCapacityMin(), param.getUnit2AvgCapacityMax());
        }

// 对于 unit2_run_capacity
        if (Func.isNotEmpty(param.getUnit2RunCapacityMin()) && Func.isEmpty(param.getUnit2RunCapacityMax())) {
            queryWrapper.gt("unit2_run_capacity", param.getUnit2RunCapacityMin());
        } else if (Func.isEmpty(param.getUnit2RunCapacityMin()) && Func.isNotEmpty(param.getUnit2RunCapacityMax())) {
            queryWrapper.lt("unit2_run_capacity", param.getUnit2RunCapacityMax());
        } else if (Func.isNotEmpty(param.getUnit2RunCapacityMin()) && Func.isNotEmpty(param.getUnit2RunCapacityMax())) {
            queryWrapper.between("unit2_run_capacity", param.getUnit2RunCapacityMin(), param.getUnit2RunCapacityMax());
        }

// 对于 unit2_standby_capacity
        if (Func.isNotEmpty(param.getUnit2StandbyCapacityMin()) && Func.isEmpty(param.getUnit2StandbyCapacityMax())) {
            queryWrapper.gt("unit2_standby_capacity", param.getUnit2StandbyCapacityMin());
        } else if (Func.isEmpty(param.getUnit2StandbyCapacityMin()) && Func.isNotEmpty(param.getUnit2StandbyCapacityMax())) {
            queryWrapper.lt("unit2_standby_capacity", param.getUnit2StandbyCapacityMax());
        } else if (Func.isNotEmpty(param.getUnit2StandbyCapacityMin()) && Func.isNotEmpty(param.getUnit2StandbyCapacityMax())) {
            queryWrapper.between("unit2_standby_capacity", param.getUnit2StandbyCapacityMin(), param.getUnit2StandbyCapacityMax());
        }


        // 对于 unit2_maintenance_capacity
        if (Func.isNotEmpty(param.getUnit2MaintenanceCapacityMin()) && Func.isEmpty(param.getUnit2MaintenanceCapacityMax())) {
            queryWrapper.gt("unit2_maintenance_capacity", param.getUnit2MaintenanceCapacityMin());
        } else if (Func.isEmpty(param.getUnit2MaintenanceCapacityMin()) && Func.isNotEmpty(param.getUnit2MaintenanceCapacityMax())) {
            queryWrapper.lt("unit2_maintenance_capacity", param.getUnit2MaintenanceCapacityMax());
        } else if (Func.isNotEmpty(param.getUnit2MaintenanceCapacityMin()) && Func.isNotEmpty(param.getUnit2MaintenanceCapacityMax())) {
            queryWrapper.between("unit2_maintenance_capacity", param.getUnit2MaintenanceCapacityMin(), param.getUnit2MaintenanceCapacityMax());
        }

// 对于 unit2_generation
        if (Func.isNotEmpty(param.getUnit2GenerationMin()) && Func.isEmpty(param.getUnit2GenerationMax())) {
            queryWrapper.gt("unit2_generation", param.getUnit2GenerationMin());
        } else if (Func.isEmpty(param.getUnit2GenerationMin()) && Func.isNotEmpty(param.getUnit2GenerationMax())) {
            queryWrapper.lt("unit2_generation", param.getUnit2GenerationMax());
        } else if (Func.isNotEmpty(param.getUnit2GenerationMin()) && Func.isNotEmpty(param.getUnit2GenerationMax())) {
            queryWrapper.between("unit2_generation", param.getUnit2GenerationMin(), param.getUnit2GenerationMax());
        }

// 对于 unit2_util_hours
        if (Func.isNotEmpty(param.getUnit2UtilHoursMin()) && Func.isEmpty(param.getUnit2UtilHoursMax())) {
            queryWrapper.gt("unit2_util_hours", param.getUnit2UtilHoursMin());
        } else if (Func.isEmpty(param.getUnit2UtilHoursMin()) && Func.isNotEmpty(param.getUnit2UtilHoursMax())) {
            queryWrapper.lt("unit2_util_hours", param.getUnit2UtilHoursMax());
        } else if (Func.isNotEmpty(param.getUnit2UtilHoursMin()) && Func.isNotEmpty(param.getUnit2UtilHoursMax())) {
            queryWrapper.between("unit2_util_hours", param.getUnit2UtilHoursMin(), param.getUnit2UtilHoursMax());
        }

// 对于 unit2_load_rate
        if (Func.isNotEmpty(param.getUnit2LoadRateMin()) && Func.isEmpty(param.getUnit2LoadRateMax())) {
            queryWrapper.gt("unit2_load_rate", param.getUnit2LoadRateMin());
        } else if (Func.isEmpty(param.getUnit2LoadRateMin()) && Func.isNotEmpty(param.getUnit2LoadRateMax())) {
            queryWrapper.lt("unit2_load_rate", param.getUnit2LoadRateMax());
        } else if (Func.isNotEmpty(param.getUnit2LoadRateMin()) && Func.isNotEmpty(param.getUnit2LoadRateMax())) {
            queryWrapper.between("unit2_load_rate", param.getUnit2LoadRateMin(), param.getUnit2LoadRateMax());
        }

// 对于 unit3_avg_capacity
        if (Func.isNotEmpty(param.getUnit3AvgCapacityMin()) && Func.isEmpty(param.getUnit3AvgCapacityMax())) {
            queryWrapper.gt("unit3_avg_capacity", param.getUnit3AvgCapacityMin());
        } else if (Func.isEmpty(param.getUnit3AvgCapacityMin()) && Func.isNotEmpty(param.getUnit3AvgCapacityMax())) {
            queryWrapper.lt("unit3_avg_capacity", param.getUnit3AvgCapacityMax());
        } else if (Func.isNotEmpty(param.getUnit3AvgCapacityMin()) && Func.isNotEmpty(param.getUnit3AvgCapacityMax())) {
            queryWrapper.between("unit3_avg_capacity", param.getUnit3AvgCapacityMin(), param.getUnit3AvgCapacityMax());
        }

// 对于 unit3_run_capacity
        if (Func.isNotEmpty(param.getUnit3RunCapacityMin()) && Func.isEmpty(param.getUnit3RunCapacityMax())) {
            queryWrapper.gt("unit3_run_capacity", param.getUnit3RunCapacityMin());
        } else if (Func.isEmpty(param.getUnit3RunCapacityMin()) && Func.isNotEmpty(param.getUnit3RunCapacityMax())) {
            queryWrapper.lt("unit3_run_capacity", param.getUnit3RunCapacityMax());
        } else if (Func.isNotEmpty(param.getUnit3RunCapacityMin()) && Func.isNotEmpty(param.getUnit3RunCapacityMax())) {
            queryWrapper.between("unit3_run_capacity", param.getUnit3RunCapacityMin(), param.getUnit3RunCapacityMax());
        }

// 对于 unit3_standby_capacity
        if (Func.isNotEmpty(param.getUnit3StandbyCapacityMin()) && Func.isEmpty(param.getUnit3StandbyCapacityMax())) {
            queryWrapper.gt("unit3_standby_capacity", param.getUnit3StandbyCapacityMin());
        } else if (Func.isEmpty(param.getUnit3StandbyCapacityMin()) && Func.isNotEmpty(param.getUnit3StandbyCapacityMax())) {
            queryWrapper.lt("unit3_standby_capacity", param.getUnit3StandbyCapacityMax());
        } else if (Func.isNotEmpty(param.getUnit3StandbyCapacityMin()) && Func.isNotEmpty(param.getUnit3StandbyCapacityMax())) {
            queryWrapper.between("unit3_standby_capacity", param.getUnit3StandbyCapacityMin(), param.getUnit3StandbyCapacityMax());
        }

// 对于 unit3_maintenance_capacity
        if (Func.isNotEmpty(param.getUnit3MaintenanceCapacityMin()) && Func.isEmpty(param.getUnit3MaintenanceCapacityMax())) {
            queryWrapper.gt("unit3_maintenance_capacity", param.getUnit3MaintenanceCapacityMin());
        } else if (Func.isEmpty(param.getUnit3MaintenanceCapacityMin()) && Func.isNotEmpty(param.getUnit3MaintenanceCapacityMax())) {
            queryWrapper.lt("unit3_maintenance_capacity", param.getUnit3MaintenanceCapacityMax());
        } else if (Func.isNotEmpty(param.getUnit3MaintenanceCapacityMin()) && Func.isNotEmpty(param.getUnit3MaintenanceCapacityMax())) {
            queryWrapper.between("unit3_maintenance_capacity", param.getUnit3MaintenanceCapacityMin(), param.getUnit3MaintenanceCapacityMax());
        }

// 对于 unit3_generation
        if (Func.isNotEmpty(param.getUnit3GenerationMin()) && Func.isEmpty(param.getUnit3GenerationMax())) {
            queryWrapper.gt("unit3_generation", param.getUnit3GenerationMin());
        } else if (Func.isEmpty(param.getUnit3GenerationMin()) && Func.isNotEmpty(param.getUnit3GenerationMax())) {
            queryWrapper.lt("unit3_generation", param.getUnit3GenerationMax());
        } else if (Func.isNotEmpty(param.getUnit3GenerationMin()) && Func.isNotEmpty(param.getUnit3GenerationMax())) {
            queryWrapper.between("unit3_generation", param.getUnit3GenerationMin(), param.getUnit3GenerationMax());
        }

// 对于 unit3_util_hours
        if (Func.isNotEmpty(param.getUnit3UtilHoursMin()) && Func.isEmpty(param.getUnit3UtilHoursMax())) {
            queryWrapper.gt("unit3_util_hours", param.getUnit3UtilHoursMin());
        } else if (Func.isEmpty(param.getUnit3UtilHoursMin()) && Func.isNotEmpty(param.getUnit3UtilHoursMax())) {
            queryWrapper.lt("unit3_util_hours", param.getUnit3UtilHoursMax());
        } else if (Func.isNotEmpty(param.getUnit3UtilHoursMin()) && Func.isNotEmpty(param.getUnit3UtilHoursMax())) {
            queryWrapper.between("unit3_util_hours", param.getUnit3UtilHoursMin(), param.getUnit3UtilHoursMax());
        }

// 对于 unit3_load_rate
        if (Func.isNotEmpty(param.getUnit3LoadRateMin()) && Func.isEmpty(param.getUnit3LoadRateMax())) {
            queryWrapper.gt("unit3_load_rate", param.getUnit3LoadRateMin());
        } else if (Func.isEmpty(param.getUnit3LoadRateMin()) && Func.isNotEmpty(param.getUnit3LoadRateMax())) {
            queryWrapper.lt("unit3_load_rate", param.getUnit3LoadRateMax());
        } else if (Func.isNotEmpty(param.getUnit3LoadRateMin()) && Func.isNotEmpty(param.getUnit3LoadRateMax())) {
            queryWrapper.between("unit3_load_rate", param.getUnit3LoadRateMin(), param.getUnit3LoadRateMax());
        }
// 对于 unit4_avg_capacity
        if (Func.isNotEmpty(param.getUnit4AvgCapacityMin()) && Func.isEmpty(param.getUnit4AvgCapacityMax())) {
            queryWrapper.gt("unit4_avg_capacity", param.getUnit4AvgCapacityMin());
        } else if (Func.isEmpty(param.getUnit4AvgCapacityMin()) && Func.isNotEmpty(param.getUnit4AvgCapacityMax())) {
            queryWrapper.lt("unit4_avg_capacity", param.getUnit4AvgCapacityMax());
        } else if (Func.isNotEmpty(param.getUnit4AvgCapacityMin()) && Func.isNotEmpty(param.getUnit4AvgCapacityMax())) {
            queryWrapper.between("unit4_avg_capacity", param.getUnit4AvgCapacityMin(), param.getUnit4AvgCapacityMax());
        }

// 对于 unit4_run_capacity
        if (Func.isNotEmpty(param.getUnit4RunCapacityMin()) && Func.isEmpty(param.getUnit4RunCapacityMax())) {
            queryWrapper.gt("unit4_run_capacity", param.getUnit4RunCapacityMin());
        } else if (Func.isEmpty(param.getUnit4RunCapacityMin()) && Func.isNotEmpty(param.getUnit4RunCapacityMax())) {
            queryWrapper.lt("unit4_run_capacity", param.getUnit4RunCapacityMax());
        } else if (Func.isNotEmpty(param.getUnit4RunCapacityMin()) && Func.isNotEmpty(param.getUnit4RunCapacityMax())) {
            queryWrapper.between("unit4_run_capacity", param.getUnit4RunCapacityMin(), param.getUnit4RunCapacityMax());
        }

// 对于 unit4_standby_capacity
        if (Func.isNotEmpty(param.getUnit4StandbyCapacityMin()) && Func.isEmpty(param.getUnit4StandbyCapacityMax())) {
            queryWrapper.gt("unit4_standby_capacity", param.getUnit4StandbyCapacityMin());
        } else if (Func.isEmpty(param.getUnit4StandbyCapacityMin()) && Func.isNotEmpty(param.getUnit4StandbyCapacityMax())) {
            queryWrapper.lt("unit4_standby_capacity", param.getUnit4StandbyCapacityMax());
        } else if (Func.isNotEmpty(param.getUnit4StandbyCapacityMin()) && Func.isNotEmpty(param.getUnit4StandbyCapacityMax())) {
            queryWrapper.between("unit4_standby_capacity", param.getUnit4StandbyCapacityMin(), param.getUnit4StandbyCapacityMax());
        }

// 对于 unit4_maintenance_capacity
        if (Func.isNotEmpty(param.getUnit4MaintenanceCapacityMin()) && Func.isEmpty(param.getUnit4MaintenanceCapacityMax())) {
            queryWrapper.gt("unit4_maintenance_capacity", param.getUnit4MaintenanceCapacityMin());
        } else if (Func.isEmpty(param.getUnit4MaintenanceCapacityMin()) && Func.isNotEmpty(param.getUnit4MaintenanceCapacityMax())) {
            queryWrapper.lt("unit4_maintenance_capacity", param.getUnit4MaintenanceCapacityMax());
        } else if (Func.isNotEmpty(param.getUnit4MaintenanceCapacityMin()) && Func.isNotEmpty(param.getUnit4MaintenanceCapacityMax())) {
            queryWrapper.between("unit4_maintenance_capacity", param.getUnit4MaintenanceCapacityMin(), param.getUnit4MaintenanceCapacityMax());
        }

// 对于 unit4_generation
        if (Func.isNotEmpty(param.getUnit4GenerationMin()) && Func.isEmpty(param.getUnit4GenerationMax())) {
            queryWrapper.gt("unit4_generation", param.getUnit4GenerationMin());
        } else if (Func.isEmpty(param.getUnit4GenerationMin()) && Func.isNotEmpty(param.getUnit4GenerationMax())) {
            queryWrapper.lt("unit4_generation", param.getUnit4GenerationMax());
        } else if (Func.isNotEmpty(param.getUnit4GenerationMin()) && Func.isNotEmpty(param.getUnit4GenerationMax())) {
            queryWrapper.between("unit4_generation", param.getUnit4GenerationMin(), param.getUnit4GenerationMax());
        }

// 对于 unit4_util_hours
        if (Func.isNotEmpty(param.getUnit4UtilHoursMin()) && Func.isEmpty(param.getUnit4UtilHoursMax())) {
            queryWrapper.gt("unit4_util_hours", param.getUnit4UtilHoursMin());
        } else if (Func.isEmpty(param.getUnit4UtilHoursMin()) && Func.isNotEmpty(param.getUnit4UtilHoursMax())) {
            queryWrapper.lt("unit4_util_hours", param.getUnit4UtilHoursMax());
        } else if (Func.isNotEmpty(param.getUnit4UtilHoursMin()) && Func.isNotEmpty(param.getUnit4UtilHoursMax())) {
            queryWrapper.between("unit4_util_hours", param.getUnit4UtilHoursMin(), param.getUnit4UtilHoursMax());
        }

// 对于 unit4_load_rate
        if (Func.isNotEmpty(param.getUnit4LoadRateMin()) && Func.isEmpty(param.getUnit4LoadRateMax())) {
            queryWrapper.gt("unit4_load_rate", param.getUnit4LoadRateMin());
        } else if (Func.isEmpty(param.getUnit4LoadRateMin()) && Func.isNotEmpty(param.getUnit4LoadRateMax())) {
            queryWrapper.lt("unit4_load_rate", param.getUnit4LoadRateMax());
        } else if (Func.isNotEmpty(param.getUnit4LoadRateMin()) && Func.isNotEmpty(param.getUnit4LoadRateMax())) {
            queryWrapper.between("unit4_load_rate", param.getUnit4LoadRateMin(), param.getUnit4LoadRateMax());
        }

// 对于 unit5_avg_capacity
        if (Func.isNotEmpty(param.getUnit5AvgCapacityMin()) && Func.isEmpty(param.getUnit5AvgCapacityMax())) {
            queryWrapper.gt("unit5_avg_capacity", param.getUnit5AvgCapacityMin());
        } else if (Func.isEmpty(param.getUnit5AvgCapacityMin()) && Func.isNotEmpty(param.getUnit5AvgCapacityMax())) {
            queryWrapper.lt("unit5_avg_capacity", param.getUnit5AvgCapacityMax());
        } else if (Func.isNotEmpty(param.getUnit5AvgCapacityMin()) && Func.isNotEmpty(param.getUnit5AvgCapacityMax())) {
            queryWrapper.between("unit5_avg_capacity", param.getUnit5AvgCapacityMin(), param.getUnit5AvgCapacityMax());
        }

// 对于 unit5_run_capacity
        if (Func.isNotEmpty(param.getUnit5RunCapacityMin()) && Func.isEmpty(param.getUnit5RunCapacityMax())) {
            queryWrapper.gt("unit5_run_capacity", param.getUnit5RunCapacityMin());
        } else if (Func.isEmpty(param.getUnit5RunCapacityMin()) && Func.isNotEmpty(param.getUnit5RunCapacityMax())) {
            queryWrapper.lt("unit5_run_capacity", param.getUnit5RunCapacityMax());
        } else if (Func.isNotEmpty(param.getUnit5RunCapacityMin()) && Func.isNotEmpty(param.getUnit5RunCapacityMax())) {
            queryWrapper.between("unit5_run_capacity", param.getUnit5RunCapacityMin(), param.getUnit5RunCapacityMax());
        }

// 对于 unit5_standby_capacity
        if (Func.isNotEmpty(param.getUnit5StandbyCapacityMin()) && Func.isEmpty(param.getUnit5StandbyCapacityMax())) {
            queryWrapper.gt("unit5_standby_capacity", param.getUnit5StandbyCapacityMin());
        } else if (Func.isEmpty(param.getUnit5StandbyCapacityMin()) && Func.isNotEmpty(param.getUnit5StandbyCapacityMax())) {
            queryWrapper.lt("unit5_standby_capacity", param.getUnit5StandbyCapacityMax());
        } else if (Func.isNotEmpty(param.getUnit5StandbyCapacityMin()) && Func.isNotEmpty(param.getUnit5StandbyCapacityMax())) {
            queryWrapper.between("unit5_standby_capacity", param.getUnit5StandbyCapacityMin(), param.getUnit5StandbyCapacityMax());
        }

// 对于 unit5_maintenance_capacity
        if (Func.isNotEmpty(param.getUnit5MaintenanceCapacityMin()) && Func.isEmpty(param.getUnit5MaintenanceCapacityMax())) {
            queryWrapper.gt("unit5_maintenance_capacity", param.getUnit5MaintenanceCapacityMin());
        } else if (Func.isEmpty(param.getUnit5MaintenanceCapacityMin()) && Func.isNotEmpty(param.getUnit5MaintenanceCapacityMax())) {
            queryWrapper.lt("unit5_maintenance_capacity", param.getUnit5MaintenanceCapacityMax());
        } else if (Func.isNotEmpty(param.getUnit5MaintenanceCapacityMin()) && Func.isNotEmpty(param.getUnit5MaintenanceCapacityMax())) {
            queryWrapper.between("unit5_maintenance_capacity", param.getUnit5MaintenanceCapacityMin(), param.getUnit5MaintenanceCapacityMax());
        }


        if (Func.isNotEmpty(param.getUnit5GenerationMin()) && Func.isNotEmpty(param.getUnit5GenerationMax())) {
            queryWrapper.between("unit5_generation", param.getUnit5GenerationMin(), param.getUnit5GenerationMax());
        } else if (Func.isNotEmpty(param.getUnit5GenerationMin())) {
            queryWrapper.ge("unit5_generation", param.getUnit5GenerationMin());
        } else if (Func.isNotEmpty(param.getUnit5GenerationMax())) {
            queryWrapper.le("unit5_generation", param.getUnit5GenerationMax());
        }

        if (Func.isNotEmpty(param.getUnit5UtilHoursMin()) && Func.isNotEmpty(param.getUnit5UtilHoursMax())) {
            queryWrapper.between("unit5_util_hours", param.getUnit5UtilHoursMin(), param.getUnit5UtilHoursMax());
        } else if (Func.isNotEmpty(param.getUnit5UtilHoursMin())) {
            queryWrapper.ge("unit5_util_hours", param.getUnit5UtilHoursMin());
        } else if (Func.isNotEmpty(param.getUnit5UtilHoursMax())) {
            queryWrapper.le("unit5_util_hours", param.getUnit5UtilHoursMax());
        }

        if (Func.isNotEmpty(param.getUnit5LoadRateMin()) && Func.isNotEmpty(param.getUnit5LoadRateMax())) {
            queryWrapper.between("unit5_load_rate", param.getUnit5LoadRateMin(), param.getUnit5LoadRateMax());
        } else if (Func.isNotEmpty(param.getUnit5LoadRateMin())) {
            queryWrapper.ge("unit5_load_rate", param.getUnit5LoadRateMin());
        } else if (Func.isNotEmpty(param.getUnit5LoadRateMax())) {
            queryWrapper.le("unit5_load_rate", param.getUnit5LoadRateMax());
        }

        if (Func.isNotEmpty(param.getUnit6AvgCapacityMin()) && Func.isNotEmpty(param.getUnit6AvgCapacityMax())) {
            queryWrapper.between("unit6_avg_capacity", param.getUnit6AvgCapacityMin(), param.getUnit6AvgCapacityMax());
        } else if (Func.isNotEmpty(param.getUnit6AvgCapacityMin())) {
            queryWrapper.ge("unit6_avg_capacity", param.getUnit6AvgCapacityMin());
        } else if (Func.isNotEmpty(param.getUnit6AvgCapacityMax())) {
            queryWrapper.le("unit6_avg_capacity", param.getUnit6AvgCapacityMax());
        }

        if (Func.isNotEmpty(param.getUnit6RunCapacityMin()) && Func.isNotEmpty(param.getUnit6RunCapacityMax())) {
            queryWrapper.between("unit6_run_capacity", param.getUnit6RunCapacityMin(), param.getUnit6RunCapacityMax());
        } else if (Func.isNotEmpty(param.getUnit6RunCapacityMin())) {
            queryWrapper.ge("unit6_run_capacity", param.getUnit6RunCapacityMin());
        } else if (Func.isNotEmpty(param.getUnit6RunCapacityMax())) {
            queryWrapper.le("unit6_run_capacity", param.getUnit6RunCapacityMax());
        }

        if (Func.isNotEmpty(param.getUnit6StandbyCapacityMin()) && Func.isNotEmpty(param.getUnit6StandbyCapacityMax())) {
            queryWrapper.between("unit6_standby_capacity", param.getUnit6StandbyCapacityMin(), param.getUnit6StandbyCapacityMax());
        } else if (Func.isNotEmpty(param.getUnit6StandbyCapacityMin())) {
            queryWrapper.ge("unit6_standby_capacity", param.getUnit6StandbyCapacityMin());
        } else if (Func.isNotEmpty(param.getUnit6StandbyCapacityMax())) {
            queryWrapper.le("unit6_standby_capacity", param.getUnit6StandbyCapacityMax());
        }

        if (Func.isNotEmpty(param.getUnit6MaintenanceCapacityMin()) && Func.isNotEmpty(param.getUnit6MaintenanceCapacityMax())) {
            queryWrapper.between("unit6_maintenance_capacity", param.getUnit6MaintenanceCapacityMin(), param.getUnit6MaintenanceCapacityMax());
        } else if (Func.isNotEmpty(param.getUnit6MaintenanceCapacityMin())) {
            queryWrapper.ge("unit6_maintenance_capacity", param.getUnit6MaintenanceCapacityMin());
        } else if (Func.isNotEmpty(param.getUnit6MaintenanceCapacityMax())) {
            queryWrapper.le("unit6_maintenance_capacity", param.getUnit6MaintenanceCapacityMax());
        }

        if (Func.isNotEmpty(param.getUnit6GenerationMin()) && Func.isNotEmpty(param.getUnit6GenerationMax())) {
            queryWrapper.between("unit6_generation", param.getUnit6GenerationMin(), param.getUnit6GenerationMax());
        } else if (Func.isNotEmpty(param.getUnit6GenerationMin())) {
            queryWrapper.ge("unit6_generation", param.getUnit6GenerationMin());
        } else if (Func.isNotEmpty(param.getUnit6GenerationMax())) {
            queryWrapper.le("unit6_generation", param.getUnit6GenerationMax());
        }

        if (Func.isNotEmpty(param.getUnit6UtilHoursMin()) && Func.isNotEmpty(param.getUnit6UtilHoursMax())) {
            queryWrapper.between("unit6_util_hours", param.getUnit6UtilHoursMin(), param.getUnit6UtilHoursMax());
        } else if (Func.isNotEmpty(param.getUnit6UtilHoursMin())) {
            queryWrapper.ge("unit6_util_hours", param.getUnit6UtilHoursMin());
        } else if (Func.isNotEmpty(param.getUnit6UtilHoursMax())) {
            queryWrapper.le("unit6_util_hours", param.getUnit6UtilHoursMax());
        }

        if (Func.isNotEmpty(param.getUnit6LoadRateMin()) && Func.isNotEmpty(param.getUnit6LoadRateMax())) {
            queryWrapper.between("unit6_load_rate", param.getUnit6LoadRateMin(), param.getUnit6LoadRateMax());
        } else if (Func.isNotEmpty(param.getUnit6LoadRateMin())) {
            queryWrapper.ge("unit6_load_rate", param.getUnit6LoadRateMin());
        } else if (Func.isNotEmpty(param.getUnit6LoadRateMax())) {
            queryWrapper.le("unit6_load_rate", param.getUnit6LoadRateMax());
        }*/

        return list(queryWrapper);
    }
}
